package main

import "fmt"

func main() {
	//基本语法
	defer fmt.Println("world") // 延迟执行
	fmt.Println("hello")
	//多个defer
	defer fmt.Println("defer 1")
	defer fmt.Println("defer 2")
	fmt.Println("start")
	//不会影响参数，只会影响函数调用
	i := 1
	defer fmt.Println(i)
	i++
	fmt.Println(i)
}
